package dictcn.com.model;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;


public class AccessSinaUserId {
	private static final String PREFERENCES_NAME_SINA = "sinaUserId";

	public static void keepUidAccessToken(Context context, String uid) {	
		SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME_SINA, Context.MODE_PRIVATE);
		Editor editor = pref.edit();
		editor.putString("uid", uid);
		editor.commit();
	}

	
	public static void clearUidToken(Context context){
	    SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME_SINA, Context.MODE_PRIVATE);
	    Editor editor = pref.edit();
	    editor.clear();
	    editor.commit();
	}

	public static String readUidAccessToken(Context context){
		SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME_SINA, Context.MODE_PRIVATE);
		return pref.getString("uid", "-1");
	}
}
